<!DOCTYPE html>
<html lang="zh">
	<head>
		<meta charset="utf-8" />
		<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no" />
		<link rel="stylesheet" href="editormd.preview.css" />
		<link rel="stylesheet" href="editormd.css" />
		<link rel="stylesheet" href="katex.min.css" />
		<script type="text/javascript" src="../js/uni.webview.1.5.5.js"></script>
		<!-- <link rel="shortcut icon" href="https://pandao.github.io/editor.md/favicon.ico" type="image/x-icon" /> -->
		<style>
			#test-editormd {
				width: 100%;
				min-height: 100vh !important;
				margin: 0 auto;
				overflow: hidden;
			}
			html,body{
				margin: 0;
				padding: 0;
			}
			#test-editormd-vale {
				height: 100%;
				width: 100%;
			}
		</style>
	</head>
	<body>
		<div id="test-editormd">
			<textarea id="test-editormd-vale">### Settings
		
		```javascript
		var testEditor = editormd("test-editormd", {
		    autoHeight : true
		});
		```
		</textarea>
		</div>
		<script src="js/jquery.min.js"></script>
		<script src="lib/marked.min.js"></script>
		<script src="lib/prettify.min.js"></script>
		<script src="lib/raphael.min.js"></script>
		<script src="lib/underscore.min.js"></script>
		<script src="lib/sequence-diagram.min.js"></script>
		<script src="lib/flowchart.min.js"></script>
		<script src="lib/jquery.flowchart.min.js"></script>
		<script src="editormd.js"></script>
		<script type="text/javascript">
			function markdown(nr) {
				$('#test-editormd-vale').text(nr)
				var testEditor = editormd("test-editormd", {
					width: "100%",
					height: "100vh",
					autoHeight: false,
					path: "lib/",
					htmlDecode: "style,script,iframe",
					tex: true,
					emoji: true,
					taskList: true,
					flowChart: true,
					sequenceDiagram: true
				});
			}
			// 在iframe内部执行以下代码
			var iframeId = window.frameElement.getAttribute('id');
			// 或者使用简写形式（两者等价）
			var iframeId = this.frameElement.id;
			// 等待初始化完毕
			document.addEventListener('UniAppJSBridgeReady', () => {
				window.parent.postMessage({
					action: 'onJSBridgeReady',
					data: '',
					iframeId: iframeId
				}, '*');
				uni.postMessage({
					data: {
						action: 'onJSBridgeReady'
					}
				})

			})
		</script>
	</body>
</html>